package tw.edu.tku.im.maze;

import org.json.JSONException;
import org.json.JSONObject;

import android.os.Parcel;
import android.os.Parcelable;

public class LeaveRoomRep extends RepPacket {

   int state;
   
   //-------------------------------------------------------
   public LeaveRoomRep(int state) {
      this.state = state;
   }
   
   //-------------------------------------------------------
   public int getState() {
      return this.state;
   }
   public void setState(int state) {
      this.state = state;
   }
   
   //-------------------------------------------------------
   public String toJSONString() throws JSONException {
      JSONObject result = new JSONObject();
      result.put("state", this.state);
      JSONObject jsonObj = new JSONObject();
      jsonObj.put("result", result);
      jsonObj.put("action", "leaveRoomResponse");
      return jsonObj.toString();
   }

   @Override
   public String getPacketName() {
      return "leaveRoomResponse";
   }

   @Override
   public int describeContents() {
      return 0;
   }

   @Override
   public void writeToParcel(Parcel arg0, int arg1) {
      
   }
   
}
